package com.amigo.online.provider.user.controller;

import com.amigo.online.common.base.controller.BaseController;
import com.amigo.online.common.core.response.Response;
import com.amigo.online.common.core.security.IgnoreSecurity;
import com.amigo.online.provider.user.mapper.UtilMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author kml
 * @version 1.0
 * @className UtilController
 * @description
 * @date 2019/4/10 21:57
 **/
@RestController
@RequestMapping(value = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UtilController extends BaseController {
    @Autowired
    UtilMapper utilMapper;

    @IgnoreSecurity
    @GetMapping(value = "/getValueByVersion/{version}")
    public ResponseEntity<Response> getValueByVersion(@PathVariable String version) {
        Integer value = utilMapper.getValueByVersion(version);
        return success(value == null || value > 0 ? true : false);
    }

}
